<template>
	<view class="district">
		<view class="li u-flex u-flex-col u-flex-center" v-for="(item,index) in list" :key="index"
			@click="categorySwitchTab(index)">
			<view class="li-base u-flex-center">
				<u-image :src="item.image || ''" width="120rpx" height="120rpx" :showMenuByLongpress="false"></u-image>
			</view>
			<view class="li-text">{{item.name}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		props: {
			list: {
				type: Array,
				default: (() => {
					return [];
				})
			},
		},
		methods: {
			categorySwitchTab(index) {
				this.$emit('categorySwitchTab', index)
			},
		}
	}
</script>

<style lang="scss">
	.district {
		display: grid;
		grid-column-gap: 22rpx;
		grid-template-columns: 1fr 1fr 1fr 1fr;
		grid-row-gap: 30rpx;
		margin-top: 40rpx;

		.li {

			.li-base {
				width: 120rpx;
				height: 120rpx;
				border-radius: 60rpx;
			}

			.li-text {
				line-height: 1;
				padding-top: 24rpx;
				font-size: 24rpx;
				color: #FFF8F8;
			}
		}
	}
</style>